﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CinemaMaestro.WebApplication.Models
{
    public class DirectorViewModels
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime BirthDay { get; set; }
        public byte[] Image { get; set; }

        public static implicit operator DirectorViewModels(Director director)
        {
            return new DirectorViewModels
            {
                Id = director.Id,
                FirstName = director.FirstName,
                LastName = director.LastName,
                BirthDay = director.BirthDay,
                Image = director.Image
            };
        }

        public static implicit operator Director(DirectorViewModels directorVM)
        {
            return new Director
            {
                Id = directorVM.Id,
                FirstName = directorVM.FirstName,
                LastName = directorVM.LastName,
                BirthDay = directorVM.BirthDay,
                Image = directorVM.Image
            };
        }
    }
}